home *** CD-ROM | disk | FTP | other *** search
- /*
- File: ATA_powerpc.h
-
- Description:Macintosh ATA Manager Sample
-
- Author: BB
-
- Copyright: Copyright: © 1999 by Apple Computer, Inc.
- all rights reserved.
-
- Disclaimer: You may incorporate this sample code into your applications without
- restriction, though the sample code has been provided "AS IS" and the
- responsibility for its operation is 100% yours. However, what you are
- not permitted to do is to redistribute the source as "DSC Sample Code"
- after having made changes. If you're going to re-distribute the source,
- we require that you make it clear in the source that the code was
- descended from Apple Sample Code, but that you've made changes.
-
- Change History (most recent first):
- 6/23/99 Updated for Metrowerks Codewarrior Pro 2.1(KG)
-
- */
-
- /*/*************************************************************************
- ** This definition is only used if you are generating CFM. In those cases,
- ** the "ataManager" call isn't defined. See technote 1098 for details.
- **************************************************************************/
-
- #if GENERATINGCFM
- pascal SInt16 ataManager(ataPB *pb);
-
- #define RESULT_OFFSET(type) \
- ((sizeof(type) == 1) ? 3 : ((sizeof(type) == 2) ? 1 : 0))
- #define TBTrapTableAddress(trapNum) (((trapNum & 0x03FF) << 2) + 0xE00)
-
- pascal SInt16 ataManager(ataPB *pb)
- {
- #ifdef applec
- #if sizeof(SInt16) > 4
- #error "Result types larger than 4 bytes are not supported."
- #endif
- #endif
- long private_result;
-
- private_result = CallUniversalProc(
- *(UniversalProcPtr*)TBTrapTableAddress(0xAAF1),
- kPascalStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(SInt16)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(pb))),
- pb);
- return *(((SInt16*)&private_result) + RESULT_OFFSET(SInt16));
- }
- #endif
-